package com.leapp.sk.util

import android.app.Activity
import android.app.Activity.RESULT_OK
import android.content.Intent
import com.example.mvp.view.imgselector.ImageSelector
import com.leapp.sk.inter.ImagePathInterface

/**
 * 图片返回路径
 * @author  chaohaipeng  on 2018/7/5.
 */

/**
 * 图片返回压缩后路径集合
 */
fun getResultFile(requestCode: Int, resultCode: Int, data: Intent?,context: Activity,imagePathInter: ImagePathInterface){
    if (requestCode == ImageSelector.REQUEST_SELECT_IMAGE) {
        if (resultCode == RESULT_OK) {
            val imagesPath = data?.getStringArrayListExtra(ImageSelector.SELECTED_RESULT)
            ImageCompressUtil.getCompressPath(context,imagesPath,imagePathInter)
        }
    }else{
    }
}

/**
 * 图片返回压缩后路径集合
 */
fun getNoCompressResultFile(requestCode: Int, resultCode: Int, data: Intent?,context: Activity,imagePathInter: ImagePathInterface){
    if (requestCode == ImageSelector.REQUEST_SELECT_IMAGE) {
        if (resultCode == RESULT_OK) {
            val imagesPath = data?.getStringArrayListExtra(ImageSelector.SELECTED_RESULT)
            if(imagesPath!=null&&imagesPath.size>0){
                imagePathInter.getArrayImagePath(imagesPath)
            }

        }
    }else{
    }
}

